﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class RDM : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ID = Request.QueryString["ID"].ToString();
            getdata2();
        }
    }

   
    protected void Button1_Click(object sender, EventArgs e)
    {
        ID = Request.QueryString["ID"].ToString();
        string sql;
        sql = "update  供应商服务 set 标题='" + this.TextBox1.Text + "',发布人='" + this.TextBox2.Text + "',内容='" + this.WebEditor1.Text + "' where ID='" + ID + "'";

        int result;
        result = new Class1().hsgexucute(sql);
        if (result == 1)
        {
            Response.Write("<script>javascript:alert('操作成功');</script>");
        }
        else
        {
            Response.Write("<script>javascript:alert('系统错误，您没有设置好数据库的连接！');</script>");
        }
    }

    private void getdata2()
    {
        ID = Request.QueryString["ID"].ToString();
        string sql = "select * from 供应商服务 where ID='" + ID + "'";
        DataSet result = new DataSet();
        result = new Class1().hsggetdata(sql);
        if (result != null)
        {
            if (result.Tables[0].Rows.Count > 0)
            {
                this.TextBox1.Text = result.Tables[0].Rows[0]["标题"].ToString().Trim();
                TextBox2.Text = result.Tables[0].Rows[0]["发布人"].ToString().Trim();
                this.WebEditor1.Text = result.Tables[0].Rows[0]["内容"].ToString().Trim();
            }
        }
    }
   
   
}
